﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.Text;
using System.ServiceModel.Web;

namespace JsonServer
{
    // NOTE: You can use the "Rename" command on the "Refactor" menu to change the interface name "IFypService" in both code and config file together.
    [ServiceContract]
    public interface IFypService
    {
        [OperationContract]
        [WebInvoke(Method = "GET",
                          ResponseFormat = WebMessageFormat.Json,
                          UriTemplate = "/single/{id}")]
        Power GetOnePower(string id);

        [OperationContract]
        [WebInvoke(Method = "POST",
                          ResponseFormat = WebMessageFormat.Json,
                          RequestFormat= WebMessageFormat.Json,
                          UriTemplate = "/insert")]
        void InsertPower(Power[] powerIn);

        [OperationContract]
        [WebInvoke(Method = "GET",
                          ResponseFormat = WebMessageFormat.Json,
                          UriTemplate = "/getDataInDay/{year}/{month}/{day}")]
        string GetOneDayPower(string year, string month, string day);

        [OperationContract]
        [WebInvoke(Method = "GET",
                          ResponseFormat = WebMessageFormat.Json,
                          UriTemplate = "/getDataInMonth/{year}/{month}")]
        string GetOneMonthPower(string year, string month);
        [OperationContract]
        [WebInvoke(Method = "GET",
                          ResponseFormat = WebMessageFormat.Json,
                          UriTemplate = "/getAll")]
        string GetAllPower();
        [OperationContract]
        [WebInvoke(Method = "POST",
                          ResponseFormat = WebMessageFormat.Json,
                          RequestFormat = WebMessageFormat.Json,
                          UriTemplate = "/send")]
        void InsertOneSecondPower(Power eachPower);
    }
}
